/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package com.easyskool.util;

import java.util.ArrayList;
import java.util.HashMap;
import java.util.List;

import org.hibernate.SessionFactory;
import org.hibernate.cfg.Configuration;

import com.easyskool.dao.BaseDao;
import com.easyskool.exception.DaoException;

public class HibernateUtil implements Runnable {

    private static final SessionFactory sessionFactory = buildSessionFactory();
    public static HashMap<String, ArrayList<String>> groups=new HashMap<String, ArrayList<String>>();
    public static HashMap<String,Integer> basicGroups=new  HashMap<String,Integer>();
    public static BaseDao baseDaoStatic=new  BaseDao();
    
    private static SessionFactory buildSessionFactory() {

        try {
System.out.println("########################%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%");

            // Create the SessionFactory from hibernate.cfg.xml

            return new Configuration().configure()

            .buildSessionFactory();

        } catch (Throwable ex) {

            System.err.println("Initial SessionFactory creation failed." + ex);

            throw new ExceptionInInitializerError(ex);

        }

    }
//public static void fillGroupsData() throws DaoException
//{
//new BaseDao().find(ClassDetails.class,new HashMap<String, Object>()); 
//
//}
public void run() {
	
}
    public static SessionFactory getSessionFactory() {
System.out.println("geeeeeeeeeeeeeeeeeeee$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$t");
        return sessionFactory;

    }

}

